<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>register</title>
    <!-- Bootstrap -->

    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body style="background-image: url(../images/regist_bg.jpg);">

<div class="container" style="width: 800px; height: 700px; background-color: whitesmoke; border:2px wheat solid; margin:auto;">
    <div class="row">
        <div class="col-md-8" style="margin-left: 130px">
            <div >
                <h3 style="font-weight:bold; text-align: center;";>欢迎来到恒源世家</h3><br />
            </div>
            <form id="registerform" action="user/register" method="post">
                <div class="form-group">
                    <label for="u_name">用户名</label>
                    <input type="text" class="form-control" id="u_name"  name="u_name" placeholder="请输入用户名">
                </div>

                <div class="form-group">
                    <label for="u_psd">密码</label>
                    <input type="text" class="form-control" id="u_psd" name="u_psd" placeholder="请输入密码">
                </div>
                <div class="form-group">
                    <label for="u_psd1">请确认密码</label>
                    <input type="text" class="form-control" id="u_psd1" name="u_psd1" placeholder="请确认密码">
                </div>
<!--                <div class="form-group">-->
<!--                    <label for="lastname">姓名</label>-->
<!--                    <input type="text" class="form-control" id="lastname" name="lastname" placeholder="姓名">-->
<!--                </div>-->
                <div class="form-group">
                    <label >登录角色</label>
                </div>
                <div class="radio">
                    <label>
                        <input type="radio" name="u_roleid" id="u_roleid" value=1 checked>
                        Boss
                    </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <label>
                        <input type="radio" name="u_roleid" id="u_roleid1" value=2>
                        管理员
                    </label>
                </div>
<!--                <div class="form-group">-->
<!--                    <label for="data">出生日期</label>-->
<!--                    <input type="text" class="form-control" id="data" placeholder="出生日期">-->
<!--                </div>-->
                <div class="checkbox">
                    <label>
                        <input type="checkbox"> 同意注册咱家会员
                    </label>
                </div>
                <div class="form-group">
                    <label class=" hidden " style="color: red " id="errorLog">登录错误</label>
                </div>
                <button type="submit" class="col-md-10" >提交</button>
            </form>
            <div class="form-group">
                <label id="returnlogin" class="col-md-10" style="color: #2aabd2"><a href="../index.html">-->去登录</a></label>
            </div>
        </div>
    </div>
</div>


<script src="jquery/jquery-3.4.1.min.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="jquery-validation/jquery.validate.js"></script>
<script src="jquery-validation/messages_zh.js"></script>
<script src ="js/register.js"></script>
<!--<script>-->
<!--    $(document).ready(function(){-->
<!--        $("#registerform").validate({-->
<!--            rules:{-->
<!--                u_name:{-->
<!--                    required:true,-->
<!--                    minlength:3-->
<!--                },-->
<!--                u_psd:{-->
<!--                    required: true,-->
<!--                    minlength: 6-->
<!--                },-->
<!--                u_psd1:{-->
<!--                    required: true,-->
<!--                    minlength: 6,-->
<!--                    equalTo:"[name='u_psd']"-->
<!--                }-->
<!--            },-->
<!--            messages:{-->
<!--                u_name:{-->
<!--                    required:"用户名不能为空！",-->
<!--                    minlength:"用户名不能少于3位！"-->
<!--                },-->
<!--                u_psd:{-->
<!--                    required: "密码不能为空！",-->
<!--                    minlength: "密码不能少于6位！",-->
<!--                },-->
<!--                u_psd1:{-->
<!--                    required: "确认密码不能为空",-->
<!--                    minlength: "确认密码不能少于6位",-->
<!--                    equalTo:"确认密码不一致"-->
<!--                }-->
<!--            }-->
<!--        });-->
<!--        $("#u_name").blur(function () {-->
<!--            $.ajax({-->
<!--                url:"user/CheckUserNameExits",-->
<!--                type:"post",-->
<!--                dataType:"json",-->
<!--                data:{-->
<!--                    u_name:$("#u_name").val(),-->
<!--                },-->
<!--                //result封装成立json对象，解析result.-->
<!--                success:function (result) {-->
<!--                    var errorCode = result.errorCode;-->
<!--                    // alert(JSON.stringify(result));-->
<!--                    if(errorCode==-1){-->
<!--                        var msg = result.status;-->
<!--                        $("#errorLog").text(msg);-->
<!--                        $("#errorLog").removeClass("hidden");-->
<!--                        $("#u_name").val("");-->
<!--                    }else if(errorCode==0){-->
<!--                        $("#errorLog").addClass("hidden");-->
<!--                    }-->
<!--                },-->
<!--                error:function (result) {-->

<!--                }-->
<!--            })-->
<!--        });-->
<!--        $("#u_psd1").blur(function () {-->
<!--            var psd= $("#u_psd").val();-->
<!--            var psd1= $("#u_psd1").val();-->
<!--            if(psd != psd1){-->
<!--                $("#errorLog").text("两次密码输入不一致");-->
<!--                $("#errorLog").removeClass("hidden");-->
<!--            }else{-->
<!--                $("#errorLog").addClass("hidden");-->
<!--            }-->
<!--        });-->
<!--    });-->
<!--</script>-->
</body>
</html>
